@extends("system.layout")
@section("main")
    <div class="banner two">
        <div class="container">
            <h2 class="second-head">Contact Us</h2>
        </div>
    </div>
    <!--//banner-->
    <!--contact-->
    <div class="container">
        <div class="section-contact">
            <div class="contact-main">
                <div class="col-md-6 contact-in">
                    <h5>Lorem ut perspiciatis unde omnis iste natus error sit voluptatem accusantium dolor.</h5>
                    <p class="para1">Lorem ipsum dolor sit amet. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old.  </p>
                    <div class="more-address">
                        <address>
                            <strong>Twitter, Inc.</strong><br>
                            795 Folsom Ave, Suite 600<br>
                            San Francisco, CA 94107<br>
                            <abbr title="Phone">手机号:</abbr> {{cache('kv_basic_telephone')}}
                        </address>
                        <address>
                            <strong>邮箱:</strong><br>
                            <a href="mailto:info@example.com">{{cache('kv_basic_email')}}</a>
                        </address>
                    </div>
                </div>
                <div class="col-md-6 contact-grid">
                    <form id="formAdd" name="formAdd"  required="required"  method="post" onsubmit="return checksubmit()">
                        <input type="hidden" name="_token" required="required"  id="_token" value="<?php echo csrf_token(); ?>">
                        <p class="your-para">姓名 :</p>
                        <input required="required" type="text" name ="uname" >
                        <p class="your-para">邮箱 :</p>
                        <input required="required" type="text" name ="uemail" >
                        <p class="your-para">地址 :</p>
                        <input required="required" type="text"  name = "addr" >
                        <p class="your-para">寄语 :</p>
                        <textarea required="required" cols="77" rows="6" id="content" name ="content"></textarea>
                        <div class="send">
                            <input required="required" type="submit" value="发送" >
                        </div>
                    </form>
                </div>
                <div class="clearfix"> </div>
            </div>
        </div>
    </div>
    <!--//contact-->
    </div>
    @include("system.friends")
            <!--需要引入的js :layui.all.js-->
    <script type="text/javascript" src="{{asset('/system/layui/lay/dest/layui.all.js')}}"></script>
    <script type="text/javascript">

        function checksubmit()
        {
            var url   = "{{route("system.contact")}}";
            var uname =$("input[name='uname']").val();
            var email =$("input[name='uemail']").val();
            var addr  =$("input[name='addr']").val();
            var content = $("#content").val();
            var _token = $("#_token").val();

            $.post(url,{uname:uname,email:email,addr:addr,content:content,_token:_token},function(data){
                if(data.code == 0){
                    layer.msg(data.msg,{
                        icon:6
                        ,time:2000
                        ,anim:1
                    });
                    setInterval(function(){
                        window.location.reload();
                    },2000);
                }else if(data.code == 1){
                    layer.msg(data.msg,{
                        icon:5
                        ,time:2000
                        ,anim:6
                    });
                }
            });
            return false;

        }

        $(document).ready(function() {



            /*
             var defaults = {
             containerID: 'toTop', // fading element id
             containerHoverID: 'toTopHover', // fading element hover id
             scrollSpeed: 1200,
             easingType: 'linear'
             };
             */

            $().UItoTop({ easingType: 'easeOutQuart' });

        });
    </script>
@endsection